import { v4 as uuidv4 } from "uuid";

export const getUserTempId = () => {
  // 1.要是本地有的话就从本地获取一下
  let userTempId = localStorage.getItem("userTempId");
  // 2.如果本地没有的话，就要我们自己生成一份
  if (!userTempId) {
    //如果走到这里就说明本地没有userTempId
    localStorage.setItem("userTempId", uuidv4());
  }
  return userTempId; //返回数据
};
